prog -> stmt-sequence
stmt-sequence -> statement ; stmt-sequence | statement | ε
statement -> if-stmt | while-stmt | assign-stmt | read-stmt | write-stmt | declare-stmt | return-stmt | for-stmt
stmt-block -> statement | { stmt-sequence }

if-stmt -> if ( exp ) then stmt-block | if ( exp ) then stmt-block else stmt-block

while-stmt -> while ( exp ) stmt-block
assign-stmt -> (variable = ) exp | func-call;
read-stmt -> read variable ;
write-stmt -> write exp ;

declare-stmt -> (int | real) ( (identifier [= exp ]) | (func-declare)|(identifier [ exp ]) ) ;

func-delcare-> identifier (para-list) stmt-block
func-call -> identifier (para-list) ;
para-list - > ((int | real)identifier ',')*

for-stmt -> for ((delcare-stmt| assign-stmt); exp;) stmt-block

return-stmt-> return exp;
variable -> identifier [ [ exp ] ]
exp -> addtive-exp logical-op addtive-exp | addtive-exp
addtive-exp -> term add-op additive-exp | term
term -> factor mul-op term | factor
factor -> ( exp ) | number | variable | Add-op exp
logical-op -> > | < | >= | <= | <> | ==
add-op -> + | -
mul-op -> * | /